package com.neuedu.corejava.ch10test;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import com.sun.org.apache.bcel.internal.generic.NEW;

public class SetClass {

	public static void main(String[] args) {
		Students students=new Students(1001,"lisi",'男',23);
		Students students2=new Students(1002,"xiaom",'女',22);
		Students students3=new Students(1003,"minmin",'男',22);
		
		Set studenSet =new HashSet();
		studenSet.add(students);
		studenSet.add(students2);
		studenSet.add(students3);
		studenSet.add(students2);
		
		System.out.println(studenSet.size());
		Iterator iterator=studenSet.iterator();
		while(iterator.hasNext()) {
			Object object=iterator.next();
			Students stu=(Students) object;
			System.out.println(stu);
		}
	}
}
